package com.multimedia.scala

object ArraysTest extends Application {
	var data = List(1, 2, 3, 4, 5)
	
	var sum = data.reduceLeft(_ + _)
	
	println("sum = "+sum)
	
	def sumArray(list : List[Int]) : Int = {
	  if (list.isEmpty) return 0
	  return list.head + sumArray(list.tail)
	}
	
	println("sum2 = " + sumArray(data))
}